import '@common/envExtend';
import { spring } from 'j-spring';
import { WinstonLog } from 'j-spring-log';
import { springWebModule, baseWebConfiguration } from 'j-spring-web';
import { IndexApi } from '@api/index';
import { sqliteModule } from 'j-spring-jpa'; // mysql
import { UserEntity } from '@entity/userEntity';

//环境扩展
spring
  .loadConfigFile(`./config/${__dev__ ? 'dev' : 'production'}.yaml`)
  .loadLogger(WinstonLog)
  .bindModule([
    sqliteModule([UserEntity]),
    springWebModule([IndexApi]),
    baseWebConfiguration,
  ])
  .invokeStarter();
